package entity

import (
	"github.com/lib/pq"
	"manager/model/po"
)

type Store struct {
	ID int64 `gorm:"column:id;type:BIGINT;primary_key" json:"id"`

	Name string `gorm:"column:name;type:VARCHAR(255)" json:"name"`

	Addr  string `gorm:"column:addr;type:VARCHAR(255)" json:"addr"`
	Phone string `gorm:"column:phone;type:VARCHAR(255)" json:"phone"`

	Coordinate po.Point `gorm:"column:coordinate;type:POINT" json:"coordinate"`

	ManagerID int64 `gorm:"column:manager_id;type:BIGINT" json:"manager_id"`

	Images pq.StringArray `gorm:"column:images;type:VARCHAR(512)" json:"images"`

	Status int `gorm:"column:status;type:TINYINT" json:"status"`

	AreaID int64 `gorm:"column:area_id;type:BIGINT" json:"area_id"`

	ZoneCode     string `json:"zone_code"`
	CityCode     string `json:"city_code" `
	ProvinceCode string `json:"province_code"`
	CountryCode  string `json:"country_code"`

	OfflineTime int64 `gorm:"column:offline_time;type:BIGINT" json:"offline_time"`

	CreatedAt int64 `gorm:"column:created_at;type:BIGINT" json:"created_at"`

	UpdatedAt int64 `gorm:"column:updated_at;type:BIGINT" json:"updated_at"`
}

func (a *Store) TableName() string {
	return "stores"
}
